package com.changeover.gwt.client;

import com.changeover.gwt.client.controller.ViewsController;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.RootPanel;

public class Gwt implements EntryPoint {
	
	public void onModuleLoad() {
		
		HandlerManager eventBus = new HandlerManager(null);
	    ViewsController appViewer = new ViewsController(eventBus);
	    appViewer.go(RootPanel.get());
		
		/*
		 * Just a simple test for the dispatcher
		 * 

		VerticalPanel main = new VerticalPanel();
		final Label label = new Label("0");
		final Button button = new Button("OK");
		button.addClickHandler(new ClickHandler(){
			@Override
			public void onClick(ClickEvent event) {
				Dispatcher.execute(new IncrementCounterAction(Integer.valueOf(label.getText())), new AsyncCallback<IntegerResult>(){
					@Override
					public void onFailure(Throwable caught) {
						GWT.log("ERROR");
					}
					@Override
					public void onSuccess(IntegerResult result) {
						label.setText(result.getValue().toString());
					}
				});
			}
		});
		main.add(label);
		main.add(button);
		RootPanel.get().add(main);
		*/
	}
	
}
